package Test1;
//统计字符串String s =”abcAB45hhelllF599ppyyD”中大写字母、小写字母、数字个数。
public class CharCount {
    public static void main(String[] args) {
        String s = "abcAB45hhelllF599ppyyD";
        char[] arr = s.toCharArray();
        int bigchar = 0;
        int smallchar = 0;
        int number = 0;
        for(int i = 0; i < arr.length; i++) {
            if(arr[i] >= '0' && arr[i] <= '9')
                number++;
            else if(arr[i] >= 'A' && arr[i] <= 'Z')
                bigchar++;
            else if(arr[i] >= 'a' && arr[i] <= 'z')
                smallchar++;
        }
        System.out.println("大写字母个数："+bigchar);
        System.out.println("小写字母个数："+smallchar);
        System.out.println("数字个数："+number);
    }
}
